/*
 * $Id: TcpGate.h 396 2010-10-01 13:09:39Z chunghh $
 */

#ifndef _TCPGATE_CLASS_
#define _TCPGATE_CLASS_

#include "Gate.h"
#include <xp/net/TcpServer.hpp>

using namespace xp;
using namespace xp::net;

class TcpGate: public Gate, public TcpServer
{
public:
	TcpGate (const xp_char_t* name);

	int start (int flags = 0);
	int main ();
	int stop ();

protected:
	bool stop_requested;

	int handle_client (TcpSocket* sock, TcpAddress* addr);
};

#endif
